#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<string.h>
#include<assert.h>
void* my_memmove(void* dest, const void* src, int num)
{
	assert(dest && src != NULL);
	for (int i = 0; i < num; i++)
	{
		if(dest < src)
			*((char*)dest + i) = *((char*)src + i);
		else
			*((char*)dest + num -i -1) = *((char*)src + num- i -1);
	}
	return dest;
}

int main()
{
	char myname[] = "Pierre de Fermat";
	my_memmove(&myname[3], myname, 6);
	int a[10] = { 0,1,2,3,4,5,6,7,8,9 };
	my_memmove(a, &a[3], sizeof(int)*5);
	printf("%s \n", myname);
	for(int i=0;i<10;i++)
		printf("%d ",a[i]);
	
	return 0;
}